#{extends 'main.html' /}
#{set title:'Home' /}

<a href="admin/">Go to the admin section</a>

<div class="noposts">
#{ifnot posts}
	<p>No posts to display</p>
#{/ifnot}
</div>

<div class="latest">
	#{list items:posts, as:'post' }
	<div class="post">
	    <h3 class="title">
	    	<a href="@{Application.showPost(post.id)}">${post.title}</a>
	    </h3>
	    <p class="subtitle">
	    	<small>
	    		Written by <span class="author">${post.author.username}</span> in <span class="title">${post.category.title}</span> at <span class="date">${post.dateUpdated.format("yyyy-MM-dd")}. ${post.getNumberOfComments()} comments.
	    	</small>
	    </p>
	    <p class="content">
	    	${post.content}
	    </p>
	   </div>
	#{/list}
</div>